<template>
  <view class="page-wrapper page-space">
    <lg-uploader v-model="files1" tips="只能上传图片, 3MB内" size="3MB">
    </lg-uploader>
    <br>
    <lg-uploader v-model="files2" type="video" tips="只能上传视频, 5MB内" size="5MB">
    </lg-uploader>
    <br>
    <lg-uploader v-model="files3" list-type="list" type="all" tips="可上传图片或视频, 5MB内" size="5MB">
    </lg-uploader>

    <button @tap="submit">提交</button>
  </view>
</template>

<script setup lang="ts">
import {ref} from "vue";
import {useWaitUpload} from "@/soar/hooks/upload";
import LgUploader from "@/soar/components/lg-uploader/index.vue";
import {mustLogin} from "@/store/account";
import message from "@/soar/utils/message";

mustLogin();

const files1 = ref([]);
const files2 = ref([]);
const files3 = ref([]);

const { upload } = useWaitUpload();

function submit() {
  upload().then(res => {
    message.success('操作成功');
  }).finally(() => {
    uni.hideLoading();
  })
  uni.showLoading();
}

</script>

<style>

</style>
